﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using C2E2C.Repository.Repositories;
using C2E2C.Repository.Repositories.Provider;
using C2E2C.Data;
using System.Data.Entity;

namespace C2E2C.Repository
{
    public partial class UnityRepositoryContainer
    {
        partial void RepositoryRegistration(IUnityContainer unityContainer)
        {
            Database.SetInitializer(new C2E2CDatabaseCreator());
            Database.SetInitializer(new C2E2CDatabaseInitializer());

            unityContainer
                .RegisterType<DbContext, C2E2CEntityContext>(this.dbContextLifetimeManager)
                .RegisterType<IUnitOfWork, EntityUnitOfWork>()
                .RegisterType<IDbSetContainer, EntityDbSetContainer>()
                .RegisterType<IAccountRepository, AccountRepository>();
        }
    }
}
